<?php
$ttgv= new TinhTrangGV();
$dsttsgv=$ttgv->ds();
?>
<div id="module">
	<h2><span>Danh sách</span></h2>
	<?php
	echo "<table>";
		echo "<thead>";
			echo "<tr id=\"tieude\">";
				echo "<th>STT</th>";
				echo "<th>Năm học</th>";
				echo "<th colspan=\"2\">Chức Năng</th>";
			echo "</tr>";
		echo "</thead>";
	$stt=1;
	if (count($dsttsgv)>0) {
		foreach ($dsttsgv as $key) {
			echo "<tr>";
				echo "<td id=\"stt\">".$stt."</td>";
				echo "<td>".$key->getTen()."</td>";
				echo "<td class=\"hinh\"><a href=\"index.php?action=del&id=".$key->getMa()."\" tilte=\"Xóa\" onclick=\" return xoaTTGV('".$key->getTen()."');\"><img src=\"../../../images/hr.gif\" title=\"Xóa\" /></a></td>";
				echo "<td class=\"hinh\"><a href=\"index.php?action=edit&id=".$key->getMa()."\" tilte=\"Sửa\"><img src=\"../../../images/edit-icon.gif\" title=\"Sửa\" /></a></td>";
			echo "</tr>";
		$stt++;
		}
	}
	else
	{
		echo "<tr><td colspan=\"4\">Danh sách rỗng</td></tr>";
	}
	echo "<tr><td colspan=\"4\" id=\"btthem\"><a href=\"index.php?action=add\" title=\"Thêm mới\" >Thêm</a></td></tr>";
echo "</table>";
?>
</div>